﻿using GameFramework;
using GameFramework.Event;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using UnityGameFramework.Runtime;

namespace TowerDefence_Zombie
{ 
    public class ShowEntityBeDamageEventArgs :GameEventArgs
    {

       public static readonly int EventId = typeof(ShowEntityBeDamageEventArgs).GetHashCode();


        public int EntityId
        {
            get;
            private set;
        }

        public Vector3 Position
        {
            get;
            private set;
        }

        public float Damage
        {
            get;
            private set;
        }

        public bool isPoison
        {
            get;
            private set;
        }

        public ShowEntityBeDamageEventArgs()
        {
            EntityId = -1;
            Position = Vector3.zero;
            Damage = 0;
        }

        public override int Id 
        {
            get
            {
                return EventId;
            }
        }

        public static ShowEntityBeDamageEventArgs Create(int entityId, Vector3 position , float damage, bool isPoison)
        {
            ShowEntityBeDamageEventArgs showEntityBeDamageEventArgs = ReferencePool.Acquire<ShowEntityBeDamageEventArgs>();
            showEntityBeDamageEventArgs.EntityId = entityId;
            showEntityBeDamageEventArgs.Position = position;
            showEntityBeDamageEventArgs.Damage = damage;
            showEntityBeDamageEventArgs.isPoison = isPoison;
            return showEntityBeDamageEventArgs;
        }

        public override void Clear()
        {
            EntityId = -1;
            Position = Vector3.zero;
            Damage = 0;
            isPoison = false;
        }
    }
}
